﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Kairos.Models
{
    public class Mappage
    {
        public int ID { get; set; }

        [Required]
        public string Titre { get; set; }

        [Required]
        [RegularExpression(@"^\d{1,4}[,]\d{1,4}[,]\d{1,4}[,]\d{1,4}$",
            ErrorMessage="Le champ Position doit correspondre au format 'x1,y1,x2,y2'.")]
        public string Position { get; set; }

        [Required]
        public string Lien { get; set; }

        [ForeignKey("Graphe")]
        public int GrapheID { get; set; }

        // Navigation properties 
        public virtual Graphe Graphe { get; set; }
    }
}